package com.zr.domain.bar.reposotory;


import com.alibaba.fastjson.JSONObject;
import com.zr.domain.bar.entity.MarketDataEvent;
import com.zr.infrastructure.utils.BarAlgoUtil;
import redis.clients.jedis.Jedis;

public class RedisSinkRepository {
    public static void storeKLineToRedis(MarketDataEvent kLine) {
        try (Jedis jedis = new Jedis("localhost", 6379)) {
            jedis.set(BarAlgoUtil.getRedisKey(kLine), JSONObject.toJSONString(kLine));
        }
    }
}
